#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
    int n; cin >> n;
    int num = 1;
    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= n; j++)
        {
            printf("%02d", num++);
        }
        cout << endl;
    }
    cout << endl;
    num = 1;
    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= n - i; j++)
        {
            printf("  ");
        }
        while(num <= i * (i + 1) / 2)
        {
            printf("%02d", num);
            num ++;
        }
        cout << endl;
    }
    return 0;
}